package org.smile.json.gateway.handler;

import javax.servlet.ServletContext;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
/**
 * 从spring提供service类的一种接口实现
 * @author Administrator
 *
 */
public class SpringJSONServiceHandler implements JSONServiceHandler {

	public Object getBean(String serviceName,ServletContext context) {
		WebApplicationContext webappCtx = WebApplicationContextUtils.getWebApplicationContext(context);
		return webappCtx.getBean(serviceName);
	}

}
